package com.masz.lcnorder;

import com.masz.lcnorder.mapper.TbOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/lcnorder")
public class TestController {


    @Autowired
    OrderService orderService;

    @Value("${server.port}")
    private String port;

    @GetMapping("/test")
    public String test(){
        return "lcnorder-test:"+port;
    }

    @PostMapping("/addOrder")
    public String addOrder(@RequestBody TbOrder order) {
        orderService.add(order.getOrderName());
        return "添加订单";
    }

    @PostMapping("/tcc-addOrder")
    public String tccAddOrder(@RequestBody TbOrder order) {
        orderService.tccAdd(order.getOrderName());
        return "tcc 添加订单";
    }

}
